var Animate = {
    birdFly: function(num){
        var sa = cc.Animation.create();
        for (var i = 0; i < 4; i++) {
            var si = i;
            if (i == 3) {
                si = 1;
            }
            var fn = "res/images/bird" + num + "_" + si + ".png";
            sa.addSpriteFrameWithFile(fn);
        }
        sa.setDelayPerUnit(4.8 / 36);
        sa.setRestoreOriginalFrame(true);
        return cc.RepeatForever.create(cc.Animate.create(sa));
    },
    birdJump: function(){
        var jump = cc.JumpBy.create(2, cc.p(0, 0), 8, 3);
        var back = jump.reverse();
        var seq = cc.Sequence.create(jump, back);
        return cc.RepeatForever.create(seq);
    },
    birdFall: function(fun){
        !fun ? fun = cc.CallFunc.create(function(){
        }) : null;
        return cc.Sequence.create(cc.RotateTo.create(0.5, 90), fun);
    },
    birdUp: function(fun){
        !fun ? fun = cc.CallFunc.create(function(){
        }) : null;
        return cc.Sequence.create(cc.RotateTo.create(0.2, -30), cc.DelayTime.create(0.25), fun);
    }
}
